package com.example.shop.order.dto;

import com.example.shop.order.enums.PayStates;
import com.example.shop.pojo.Order;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WXPayQueryResult {
    /**
     * 订单id
     */
    private long outTradeNo;
    /**
     * 支付状态
     */
    private PayStates payStates;
    /**
     * 微信支付是采用的付款类型：Native
     */
    private String tradeType;
    /**
     * 支付凭证
     */
    private String transactionId;

    public Order toOrder(){
        Order order = new Order();
        order.setOrderId(outTradeNo)
                .setTransactionId(transactionId);
        return order;
    }
}
